<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/css/global.css">
  <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css">
  <link rel="stylesheet" href="/static/admin/plugin/layuiExtend/modules/css/formSelects.css">
  <style>
    body{
      zoom: 100%;
    }
    .layui-this a{
      color: green;
      font-weight: 800;
    }
  </style>
</head>
<body>

<form class="layui-form padding-top-20" action="{:url()}" method="post" onsubmit="return save_form(this, successFun)">

  <div class="layui-card">
    <div class="layui-card-body">
      <div class="layui-tab layui-tab-card">
        <ul class="layui-tab-title">
          {foreach $classes as $class}
          <li class="{$class.id==$class_id?'layui-this':''}">
            <a href="/admin/sys.spConfig/index?class_id={$class.id}">{$class.comment}设置</a>
          </li>
          {/foreach}

        </ul>
        <div class="layui-tab-content">
          <div class="layui-tab-item layui-show">
            {$form_items|raw}
          </div>
        </div>
      </div>
    </div>
  </div>




  <div class="layui-form-item flex-center submit-footer">
    <button type="submit" class="layui-btn">提交修改配置</button>
<!--    <span class="layui-btn layui-btn-primary margin-left-50 close">取消</span>-->
  </div>
</form>

<script src="/static/admin/layuiadmin/layui/layui.js"></script>
<script src="/static/js/jquery-3.6.2.min.js"></script>
<script src="/static/admin/plugin/select2/js/select2.full.min.js"></script>
<script src="/static/js/crypto-js.min.js"></script>
<script src="/static/admin/js/global.js"></script>



<script>
  $('.select2').select2();
</script>

<script>
  layui.config({
    base: "/static/admin/plugin/layuiExtend/modules/",
  }).extend({
    iconPicker: 'js/iconPicker'
  });
  layui.use(['iconPicker'], function () {
    let  iconPicker = layui.iconPicker;
    iconPicker.render({
      // 选择器，推荐使用input
      elem: '#iconPicker',
      // 数据类型：fontClass/unicode，推荐使用fontClass
      type: 'fontClass',
      // 是否开启搜索：true/false
      search: true,
      // 是否开启分页
      page: false,
      // 每页显示数量，默认12
      limit: 12,
      // 点击回调
      click: function (data) {
      },
      // 渲染成功后的回调
      success: function(d) {
      }
    });

  });


  layui.config({
    base: '/static/admin/plugin/layuiExtend/modules/js/' //静态资源所在路径
  });
  layui.use(['form','jquery','authtree','jquery'], function() {
    var form = layui.form;
    var $ = layui.jquery;
    var authtree = layui.authtree;
    var trees = authtree.listConvert( {:json_encode($nodes)} , {
      primaryKey: 'id'
              , startPid: 0
              , parentKey: 'pid'
              , nameKey: 'name'
              , valueKey: 'id'
              , checkedKey: 'checked'
    });
    authtree.render('#tree', trees, {
      inputname: 'selected_path',
      layfilter: 'tree',
      autowidth: true,
      checkType: 'radio',
      autochecked: false,
    });

    authtree.on('change(tree)', ()=>{
      let val = $('[name=selected_path]:checked').val()
      val = val.slice(1);
      let title = $('[name=selected_path]:checked').attr('title')
      $('#info_href').val(val);
      $('#menu_name').val(title);
      $('#href_select').hide();
    })

  })
</script>

<script>
  let successFun = function(){
    layer.msg('修改配置成功', {time: 500}, function (){
        location.reload();
    })
  }
</script>
</body>
</html>
